package com.road2trip.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.road2trip.datastore.Place;
import com.road2trip.datastore.PlaceDAO;

public class PlaceServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1689904924223564959L;

	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {

		String placeName = req.getParameter("placeName");
        req.setAttribute("placeName", placeName);
               
        try {
			getServletContext().getRequestDispatcher("/place.jsp").forward(req, resp);
			
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
        //resp.sendRedirect("/place.jsp");        

	}

	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, java.io.IOException {

        
		/*String placeName = req.getParameter("name"); 
		String lang = req.getParameter("hl");
		String localizedPlaceName = req.getParameter("lName");		
		String type = req.getParameter("type");
		String parent = req.getParameter("parent"); //english parent name 		
		
		Place place = new Place(placeName, lang);
		place.setLocalizedName(localizedPlaceName);
		place.setType(type);
		place.setParent(parent);
		
		place = PlaceDAO.getPlace(place);*/ 
	}

}